import upyun

#新建有拍云实例
up = upyun.UpYun('1907md',username='zym',password='0Fr6JYeS9L0i9RnfPNYKOFVOeH8EVQzj')

#上传文件
# up.put('/upyun_test.text','asd\n你好\n')

#文件流操作（节省内存）
# with open('./code.png','rb') as f:
    # 上传
    # res = up.put('/upyun_test.png',f,checksum=True)


#目录操作
# up.mkdir('/upyun_test/')

#移动文件
# up.move('/upyun_test.png','/upyun_test/upyun_test.png')

#复制文件
# up.copy('/upyun_test.text','/upyun_test/upyun_test1.text')

#断点续传
# with open('./test.mp4','rb') as f:
#     res = up.put('/upyun_test/test.mp4',f,checksum=True,need_resume=True)

#下载
# res = up.get('/upyun_test/upyun_test.png')
# print(res)

#删除文件
up.delete('/upyun_test/upyun_test.png')
